<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${site.name} - Powered by JavaCMS</title>
<link href="${resSys}/front.css" rel="stylesheet" type="text/css"/>
<script src="${resSys}/jquery.js" type="text/javascript"></script>
<script src="${resSys}/front.js" type="text/javascript"></script>
<script src="${base}/thirdparty/ckeditor/ckeditor.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/${res}/css/index.css" />
<script type="text/javascript">
$.validator.methods.leafChannel = function(value, element, param) {
	var i = element.selectedIndex;
	return $(element.options[i]).attr("class")!="sel-disabled";
}
$(function() {
	$("#jvForm").validate({
		rules: {
			channelId: {
				required: true,
				leafChannel: true
			}
		},
		messages:{
			channelId: {
				leafChannel: "请选择末级栏目"
			}
		}
	});
    changeModel();
    changePattern();
});
function changeModel(){
	var model=$("input[name='charge']:checked").val();
	if(model==1){
		$("#chargeAmountSpan").show();
		$("#rewardSpan").hide();
	}else if(model==2){
		$("#rewardSpan").show();
		$("#chargeAmountSpan").hide();
	}else{
		$("#chargeAmountSpan").hide();
		$("#rewardSpan").hide();
	}
}
function changePattern(){
	var model=$("input[name='rewardPattern']:checked").val();
	if(model=="true"){
		$("#rewardFixDiv").show();
		$("#rewardRandomDiv").hide();
	}else{
		$("#rewardFixDiv").hide();
		$("#rewardRandomDiv").show();
	}
}
</script>

<!--[if lt IE 9]> 
<script src="/${res}/js/html5shiv.min.js"></script>
<script src="/${res}/js/respond.min.js"></script>
<![endif]-->

<style type="text/css">
.sel-disabled{background-color:#ccc}
</style>
</head>
<body>
[#include "../include/top.html"/]
[#include "../include/header.html"/]
<div class="member-con">
  <div class="m-pos"><a href="${base}/">首页</a> > <span>会员中心</span></div>
  <div class="member clearfix">
    <div class="memberLeft clearfix"> 
      <div class="member-nav">
        <ul>
        <li><a href="${base}/member/index.jspx">个人资料</a></li>
        <li><a href="${base}/member/contribute_list.jspx">投稿管理</a></li>
        <li><a href="${base}/member/doc_list.jspx?modelId=9" class="on">文档管理</a></li>
        <li><a href="${base}/member/resume.jspx">应聘管理</a></li>
        <li><a href="${base}/member/mycomments.jspx">我的评论</a></li>
        <li><a href="${base}/member/myguestbook.jspx">我的留言</a></li>
        <li><a href="${base}/member/collection_list.jspx">我的收藏</a></li>
        <li><a href="${base}/member/message_mng.jspx">站内信息</a></li>
        <li><a href="${base}/member/account.jspx">服务中心</a></li>
        </ul>
      </div>
      <div class="member-main">
        <div class="member-child"><a href="${base}/member/doc_list.jspx?modelId=9" class="on">文档列表</a>|<a href="${base}/member/doc_add.jspx">发布文档</a></div>
        <div class="member-text tggl fbgj">
          [#include "doc_upload.html"/]
          <form id="jvForm" action="doc_update.jspx" method="post">
          <table cellpadding="0" cellspacing="0">
            <tbody>
              <tr>
                <td class="tggl-top">修改文档</td><td>
                [#list 0..0 as i]
                <div id="attachTr${i}">
                <input type="text" id="docNames${i}" name="docName" value="${content.title}" required="true" class="member-change" style="float:left; margin-left:15px; width:130px;" />
                <input type="text" id="docPaths${i}" name="docPath" value="${content.docPath!}" required="true" class="member-change" style="margin-left:6px; float:left; width:130px;" />
                <span id="afc${i}" style="position:relative;display:block;width:270px; float:left;">
                <input type='text' id='docText${i}' class="member-change" style="float:left; margin-left:6px; width:130px;"/>
                <input type="button" class="change-Btn" value="浏览" style="float:left; margin-left:8px; margin-right:0;" />
                <input onchange="$('#docText${i}').val(this.value)" size="19" type="file" name="doc" id="docFile${i}" style="height:28px;width:190px;opacity:0;filter:alpha(opacity=0);position:absolute;right:74px;top:0;cursor:pointer;"/>
                <input type="button" class="change-Btn" value="上传" onclick="uploadDoc(${i});" style="float:left; margin-left:4px;" />
                </span>
		<input type="hidden" id="docFilenames${i}" name="docFilename"/>
		<input type="hidden" id="fileSuffix" name="fileSuffix" value="${content.fileSuffix!}"/>
                </div>
                [/#list]
                </td>
              </tr>
              <tr>
                <td class="tggl-top">标题</td><td><input type="text" name="title" value="${content.title}" maxlength="255" required="true" class="member-change" style="width:529px;" /></td>
              </tr>
              <tr>
                <td class="tggl-top">财富值</td><td><input type="text" name="downNeed" value="${content.downNeed!}" maxlength="10" required="true" class="member-change" /></td>
              </tr>
              <tr>
                <td class="tggl-top">是否开放</td><td><label><input name="isOpen" type="radio" value="true" [#if content.hasOpen]checked="checked"[/#if] class="member-radio" />开放</label><label><input name="isOpen" type="radio" value="false" [#if !content.hasOpen]checked="checked"[/#if] class="member-radio" />私有</label></td>
              </tr>
              <tr>
                <td class="tggl-top">栏目</td><td>
                  <select name="channelId" class="member-change">
                    <option value="" class="sel-disabled">--请选择--</option>
	                [#if channelList?size gt 0]
	                [#assign origDeep=channelList[0].deep+1/]
	                [#list channelList as c]
	                    <option value="${c.id}"[#if c.child?size gt 0] class="sel-disabled"[/#if] [#if content.channel.id==c.id] selected="selected"[/#if]>[#if c.deep gte origDeep][#list origDeep..c.deep as i]&nbsp;&nbsp;[/#list]>[/#if]${c.name}</option>
	                [/#list]
	                [/#if]
                 </select></td>
              </tr>
              <tr>
                <td class="tggl-top">简介</td><td><textarea name="description" rows="3" cols="70" maxlength="255" />${content.description!}</textarea></td>
              </tr>
            <tr>
                <td class="tggl-top">收费设置</td>
                <td>
                	免费:<input name="charge" value="0" [#if content.chargeModel==0]checked="checked"[/#if] onclick="changeModel()" type="radio"/>
                	收费:<input name="charge" value="1" [#if content.chargeModel==1]checked="checked"[/#if] onclick="changeModel()" type="radio"/>
					打赏:<input name="charge" value="2" [#if content.chargeModel==2]checked="checked"[/#if] onclick="changeModel()" type="radio"/>
					<span id="chargeAmountSpan">金额:<input type="text" name="chargeAmount" value="${content.chargeAmount!}" required="true" class="required number" maxlength="10" style="width:100px"/></span>
					<span id="rewardSpan">
					随机:<input name="rewardPattern" value="false"  type="radio" required="true" [#if !content.rewardPattern]checked="checked"[/#if] onclick="changePattern()"/>
					固定:<input name="rewardPattern" value="true"  type="radio" required="true"  [#if content.rewardPattern]checked="checked"[/#if] onclick="changePattern()"/>
					<div id="rewardFixDiv">
					固定:
					[#if content.rewardFixs??&&content.rewardFixs?size gt 0]
					[#list content.rewardFixs as fix]
					<input type="text" name="rewardFix" value="${fix.fixVal!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[/#list]
					[#else]
					[#list config.rewardFixAttr?keys?sort as fix]
					<input type="text" name="rewardFix" value="${config.rewardFixAttr[fix]!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[/#list]
					[/#if]
					</div>
					<div id="rewardRandomDiv">
					随机范围:
					[#if content.rewardRandomMin!=0]
					<input type="text" name="rewardRandomMin" value="${content.rewardRandomMin!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[#else]
					<input type="text" name="rewardRandomMin" value="${contentChargeConfig.rewardMin!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[/#if]
					[#if content.rewardRandomMax!=0]
					<input type="text" name="rewardRandomMax" value="${content.rewardRandomMax!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[#else]
					<input type="text" name="rewardRandomMax" value="${contentChargeConfig.rewardMax!}" required="true" class="required number" maxlength="10" style="width:50px"/>
					[/#if]
					</div>
					</span>
                </td>
              </tr>
              <tr>
                <td colspan="2" style="text-align:center; padding:20px 0;">
                  <input type="hidden" name="nextUrl" value="doc_list.jspx?modelId=9"/>
                 <input type="hidden" name="id" value="${content.id}"/>
                  <input type="submit" class="member-submit" value="提交"><input type="reset" class="member-reset" value="重置"></td>
              </tr>
            </tbody>
          </table>
           </form>
        </div>
      </div>
    </div>
    [#include "../include/member-right.html" /]
    <div class="m-sj"></div>
  </div>
</div>
[#include "../include/footer.html"/]
</body>
</html>